﻿<?xml version="1.0" encoding="utf-8" ?>
<objects xmlns="http://www.springframework.net">

  <description>
    This Macro demonstrates how a Powershell Script can be run and mixed with other standard Actions.
    	
    However, any Powershell "v1" Script can be run from a Macro
  </description>

  <object id="MacroToProcess" type="Macro" >
    <constructor-arg name="templateId" value="{4C0CAF35-C2A3-4826-9453-EA421B301B7F}" />
    <constructor-arg name="actions">
      <list element-type="IAction">

		  <!-- ============================ -->
		  <!-- POWERSHELL COMMANDS          -->
		  <!-- ============================ -->
		  <object name="RunPowershellScripts" type="Action.Powershell">
          <property name="EntityList">
            <object id="ListOfPages" type="Entities">
              <constructor-arg>
                <list>
					<object name="Powershell1" id="Powershell1" type="Action.Powershell">
						<property name="EntityList">
							<object type="Entity.PowershellScriptInfo">
								<!-- This Script will be run during the "Do" -->
								<property name="DoScript">
									<object type="Entity.PowershellScript">
										<property name="ScriptFile" value="${CurrentDirectory}\..\..\_PSScripts\Export-SharePoint-List.ps1" />
										<property name="VerbosePreference" value="continue" />
										<property name="DebugPreference" value="continue" />
										<property name="ErrorActionPreference" value="continue" />
										<property name="ShouldProcessPreference" value="continue" />
										<property name="ProcessReturnPreference" value="continue" />
										<property name="Commands">
											<list element-type="string">
												<value>Export-List ${CurrentWeb.Url}/Lists/Tasks</value>
												<value>dir >${CurrentDirectory}\DirectoryListing.txt</value>
												<value>copy ${CurrentDirectory}\DirectoryListing.txt c:\temp</value>
											</list>
										</property>
									</object>
								</property>
								
								<!-- This Script will be run during the "Undo" -->
								<property name="UndoScript">
									<!-- Do Nothing -->
								</property>
							</object>
						</property>
						<property name="StopOnDoException" value="${StopOnDoException}"/>
						<property name="StopOnUndoException" value="${StopOnUndoException}"/>
						<property name="AutoUndo" value="${AutoUndo}"/>
						<property name="DisableDo" value="${DisableDo}"/>
						<property name="DisableUndo" value="${DisableUndo}"/>
					</object>
					

                </list>
              </constructor-arg>
            </object>

          </property>
          <property name="StopOnDoException" value="true"/>
        </object>
      </list>
    </constructor-arg>
  </object>



</objects>

